package cn.yunhe.biz;

import org.apache.ibatis.session.SqlSession;
import cn.yunhe.dao.BoardMapper;
import cn.yunhe.pojo.Board;
import cn.yunhe.util.SqlSessionFactoryUtil;

import java.util.List;

public class BoardService {
        SqlSession session = SqlSessionFactoryUtil.getSession();
        BoardMapper boardMapper=session.getMapper(BoardMapper.class);
        public int addBoard(Board board){
            int flag = boardMapper.addBoard(board);
            session.commit();
            return flag;
        }

        public List<Board> getAllBoard(){
            return boardMapper.getAllBoard();
        }

}

